package com.example.hello;

import com.example.hello.client.Tab.BootstrapTabState;
import com.vaadin.ui.AbstractComponent;

public class BootstrapTab extends AbstractComponent {

    public enum IconPosition {
        LEFT, RIGHT
    }

    public enum IconSize {
        DEFAULT, LARGE, TWO_TIMES, THREE_TIMES, FOUR_TIMES, FIVE_TIMES
    }

    public enum Style {
        ABOVE, BELOW, LEFT, RIGHT
    }

    public BootstrapTab() {
        this("////");
    }

    public BootstrapTab(String heading) {
        BootstrapTabPane tabPane = new BootstrapTabPane();

//        getLink().setText(heading);
//        tabPane.setHref(DOM.createUniqueId());
//
//        getLink().setTabPane(tabPane);
    }

    @Override
    protected BootstrapTabState getState() {
        return (BootstrapTabState) super.getState();
    }

    public String getHeading() {
        return getState().getHeading();
    }

    public void setHeading(String heading) {
        getState().setHeading(heading);
    }

//    public void add(Component widget) {
//        getTabPane().addWidget(widget);
//    }
//
//    public void remove(Component widget) {
//        getTabPane().removeWidget(widget);
//    }
//
//    public void clear() {
//        getTabPane().clear();
//    }
//
//    public Iterator<Component> iterator() {
//        return getTabPane().iterator();
//    }

    public boolean isActive() {
        return getState().isActive();
    }

    public void setActive(boolean active) {
        getState().setActive(active);
    }

    public String getBaseIcon() {
        return getState().getBaseIcon();
    }

    public void setBaseIcon(String baseIcon) {
        getState().setBaseIcon(baseIcon);
    }

    public boolean isWidgetEnabled() {
        return getState().isWidgetEnabled();
    }

    public void setWidgetEnabled(boolean widgetEnabled) {
        getState().setWidgetEnabled(widgetEnabled);
    }

    public String getIconType() {
        return getState().getIconType();
    }

    public void setIconType(String iconType) {
        getState().setIconType(iconType);
    }

    public IconPosition getIconPosition() {
        return IconPosition.valueOf(getState().getIconPosition());
    }

    public void setIconPosition(IconPosition iconPosition) {
        getState().setIconPosition(iconPosition.toString());
    }

    public IconSize getIconSize() {
        return IconSize.valueOf(getState().getIconSize());
    }

    public void setIconSize(IconSize iconSize) {
        getState().setIconSize(iconSize.toString());
    }

    public Style getStyle() {
        return Style.valueOf(getState().getStyle());
    }

    public void setStyle(Style style) {
        getState().setStyle(style.toString());
    }

}